package car.aistar.service.Impl.xrb;

import car.aistar.entity.Admin;
import car.aistar.service.AdminService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.Date;

/**
 * @ClassName testAdmin
 * @Description TODO
 * @Author 0927
 * @Date 2020/10/1 19:22
 * Version 1.0
 **/

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:spring/spring-*.xml")
public class testAdmin {

    @Autowired
    private AdminService adminService;


    @Test
    public void testAdminById(){
        System.out.println(adminService.queryById(2L).getAdName());
    }

    @Test
    public void testAdminByLimit(){
        System.out.println(adminService.queryAllByLimit(4,2));
    }

    @Test
    public void testAdminInsert(){
        Admin admin = new Admin(null,"赵勇","18151139235","222","xsss",new Date());
        adminService.insert(admin);
    }

    @Test
    public void testAdminUpdate(){
        Admin admin = new Admin(null,"赵勇","18151139235","222","xsss",new Date());
        adminService.update(admin);
    }

    @Test
    public void testAdminDeleteId(){
        adminService.deleteById(31L);
    }

//    @Test
//    public void testQueryAll(){
//        System.out.println(adminService.queryAll());
//    }

}
